package KUOZHAN;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class test4 {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        list.add("迪丽热巴");
        list.add("古力娜扎");
        list.add("周杰伦");
        list.add("蔡徐坤");
        for (String s : list) {
            try (BufferedWriter bew=new BufferedWriter(new FileWriter("Task.txt",true));){

                bew.write(s+"\r\n");
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

}}
